<?php
if ( !isset($_SERVER['HTTP_REFERER']) )
	$_SERVER['HTTP_REFERER'] = 'index.php';
else
	$_SERVER['HTTP_REFERER'] = basename($_SERVER['SCRIPT_FILENAME']) . '?' . $_SERVER['QUERY_STRING'];

if ( !isset($_SESSION['cur_lang']) )
{
	$_SESSION['cur_lang'] = 'vn';
	$template->assign_vars(array(
		'_NEXT_LANG'	=> '<a href="change_lang.php?lang=en&redir=' . $_SERVER['HTTP_REFERER'] . '">&raquo; English</a>'
	));
}
else /* có chọn ngôn ngữ */
{
	if ( $_SESSION['cur_lang'] == 'vn' )
		$template->assign_vars(array(
			'_NEXT_LANG'	=> '<a href="change_lang.php?lang=en&redir=' . $_SERVER['HTTP_REFERER'] . '">&raquo; English</a>'
		));
	else if ( $_SESSION['cur_lang'] == 'en' )
		$template->assign_vars(array(
			'_NEXT_LANG'	=> '<a href="change_lang.php?lang=vn&redir=' . $_SERVER['HTTP_REFERER'] . '">&raquo; Vietnamese</a>'
		));
}

$ml = 'language/' . $_SESSION['cur_lang'] . '/lang.php';
if ( file_exists($ml) )
	include($ml);

$ml = $info['template_path'] . 'language/' . $_SESSION['cur_lang'] . '/lang.php';
if ( file_exists($ml) )
	include($ml);

?>